Memory system having high data transfer efficiency and host controller

ABSTRACT

According to one embodiment, the host controller includes a register set to issue command, and a direct memory access (DMA) unit and accesses a system memory and a device. First, second, third and fourth descriptors are stored in the system memory. The first descriptor includes a set of a plurality of pointers indicating a plurality of second descriptors. Each of the second descriptors comprises the third descriptor and fourth descriptor. The third descriptor includes a command number, etc. The fourth descriptor includes information indicating addresses and sizes of a plurality of data arranged in the system memory. The DMA unit sets, in the register set, the contents of the third descriptor forming the second descriptor, from the head of the first descriptor as a start point, and transfers data between the system memory and the host controller in accordance with the contents of the fourth descriptor.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims the benefit of priorityunder 35 U.S.C. §120 from U.S. Ser. No. 13/473, 212 filed May 16, 2012,which is a continuation of U.S. Ser. No. 13/052,147 filed Mar. 21, 2011(now U.S. Pat. No. 8,195,845 issued Jun. 5, 2012), and claims thebenefit of priority under 35 U.S.C. §119 from Japanese PatentApplication No. 2010-212721 filed Sep. 22, 2010, the entire contents ofeach of which are incorporated herein by reference.

FIELD

Embodiments described herein relate generally to a host controller andmemory system to be applied to, e.g., a SD™ card, and supportingadvanced direct memory access (ADMA).

BACKGROUND

Recently, SD cards such as SD memory cards are widely used in, e.g.,cell phones and digital still cameras as host devices. This SD card isconnected to a host device via a host controller, and the hostcontroller controls data transmission between the host device and SDmemory card.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view showing the arrangement of a memory systemaccording to an embodiment;

FIG. 2 is a schematic view showing the memory maps of a system memoryand memory card;

FIG. 3 is a view showing the structure of a descriptor according to theembodiment;

FIG. 4 is a schematic view showing the arrangement of ADMA shown in FIG.1; and

FIG. 5 is a flowchart showing the operation of ADMA.

DETAILED DESCRIPTION

A system memory installed in a host device is managed by paging.Therefore, data in the system memory is fragmentarily managedpage-by-page.

To efficiently perform data read/write to a memory card, a hostcontroller supports DMA algorithm capable of data transfer managedpage-by-page. That is, data fragmented in the system memory can betransferred by DMA by using a descriptor as a data transfer list.

Unfortunately, conventional DMA algorithm generates an interrupt inorder to generate a new system address in the boundary between pages.This disturbs the operation of a CPU. ADMA has been developed in orderto eliminate this problem.

ADMA has a function of transferring data to fragmented data areas in thesystem memory by paging, in accordance with one read/write command of anSD card. Accordingly, ADMA controls data transfer between the hostcontroller and system memory without any interrupt to the CPU by loadingthe descriptor in the system memory. A host driver controls the issue ofa command to the memory card by setting a register set in the hostcontroller, thereby controlling data transfer between the hostcontroller and memory card, and interruption to the CPU has been used.This method poses no problem when the bus performance is low as in aconventional memory.

As the bus performance improves and high-speed data transfer becomespossible in recent years, however, the processing of the host drivergenerates an overhead. Since it is not always possible to continuouslyuse the area of the memory card, a memory command must be divided into aplurality of memory commands. To control command issue to the memorycard by the host driver, the host driver must be executed by causing thehost CPU to generate an interrupt midway along data transfer. Therefore,it takes a certain time to respond to the interrupt. This deterioratesthe performance because of the influence of the waiting time of thedriver processing even when using a high-speed bus.

Accordingly, demands have arisen for a method of efficiently performingdata transfer by making it possible to execute, by DMA, the processingrequiring the host driver during data transfer.

Embodiment

In general, according to one embodiment, a memory system includes a hostcontroller and DMA unit. The host controller includes a register setconfigured to control command issue to a device, and a direct memoryaccess (DMA) unit configured to access a system memory, and controlstransfer between the system memory and the device. First, second, thirdand fourth descriptors are stored in the system memory. The firstdescriptor includes a set of a plurality of pointers indicating aplurality of second descriptors. Each of the second descriptorscomprises the third descriptor and fourth descriptor. The thirddescriptor includes a command number, a command operation mode, and anargument as information necessary to issue a command to the device, anda block length and the number of blocks as information necessary fordata transfer. The fourth descriptor includes information indicatingaddresses and sizes of a plurality of data arranged in the systemmemory. The ADMA unit sets, in the register set, the contents of thethird descriptor forming the second descriptor, from the head of thefirst descriptor as a start point, and loads and transfers data from thesystem memory in accordance with the contents of the fourth descriptor.

The embodiment will be explained below with reference to theaccompanying drawing. The ADMA described below is an ADMA improved bythe embodiment.

FIG. 1 schematically shows the memory system according to thisembodiment.

This embodiment makes it possible to issue SD commands by a hostcontroller during DMA transfer by extending a descriptor capable of datatransfer of a system memory, thereby reducing the overhead caused byhost driver processing.

A system controller 11 shown in FIG. 1 controls interfaces with a CPU12, system memory 13, and SD controller 14.

The system memory 13 stores a host driver 21, descriptor table 22, anddata 23. An operating system (OS) secures areas required to store thehost driver 21, descriptor table 22, and data 23 in the system memory13.

The host driver 21 is a driver provided for, e.g., the SD hostcontroller 14 and unique to the OS, and is executed by the CPU 12. Thehost driver 21 generates the descriptor table 22 before executing ADMA(to be described later). The descriptor table 22 is a list ofinformation necessary for data transfer between the system memory 13 andan SD card, and is described by format which can be interpreted by theSD host controller. The structure of the descriptor table 22 will bedescribed later.

The SD host controller 14 has a function of bidirectionally transferringdata between the system memory 13 and an SD card by using SD commands.The SD host controller 14 mainly includes a system bus interface circuit31, a memory card interface circuit 32, a register set 33 including aplurality of registers, an ADMA 34, and a timer 35.

The system bus interface circuit 31 is connected to the systemcontroller 11 via a system bus. The memory card interface circuit 32 isconnectable to SD cards, e.g., an SD memory card 15 and SDIO card 16,via an SD bus interface (not shown). The SD bus interface is not limitedto 4-bits type, but can be applied to e.g. UHS (Ultra High Speed)-IIusing LVDS (Low Voltage Differential Signaling) system. In UHS-II,commands are transferred in packet form.

The register set 33 of the SD host controller 14 is classified into aplurality of units (not shown) such as an SD command generation unit,response unit, buffer data port unit, host control unit, interruptcontrol unit, and ADMA unit. Information such as a command number,command mode, and argument necessary to issue an SD command andinformation such as a block length and the number of blocks necessary totransfer data are set in the SD command generation unit of the registerset 33. When these pieces of information are set, the SD commandgeneration unit issues a command to an SD card. The response unit in theregister set 33 receives a response supplied from the SD card inresponse to the command.

The ADMA 34 is a circuit for transferring data between an SD card andthe system memory 13 without any intervention of the CPU 12. The ADMA 34executes data transfer in accordance with contents described in thedescriptor table 22 in the system memory 13.

The timer 35 detects a timeout error. For example, the timer 35 detectsa timeout error if the operation of a read command is not completewithin a time set from the issue to the end of the read command. The CPU12 is notified of this timeout error by an interrupt, and the timeouterror is processed by the host driver.

FIG. 2 shows an example of the relationship between paging management ofthe system memory 13 and SD physical addresses. The system memory 13 ismanaged by paging for each small area, e.g., a 4-Kbyte area. Anapplication executed by the host CPU 12 accesses the system memory 13 bya logical address by using a paging function managed by the host CPU 12.As indicated by a logical address system memory map, therefore, data areapparently arranged in a continuous address area. However, positions inthe system memory 13 in which data are actually recorded are arbitrary,and fragmented as indicated by a physical address system memory map.These data are managed by the addresses and data lengths. The datalength is variable. Also, the relationship between the physical addressand logical address of data stored in the system memory 13 is managed bya page table (not shown).

On the other hand, data stored in the SD memory card 13 are managed foreach page (each block) having, e.g., 512 bytes to a few Mbytes, andcompletely independent of the system memory 13. When data in the systemmemory 13 is to be stored in the SD memory card 15, therefore, asindicated by an SD physical address memory map, the data in the systemmemory 13 is stored by a size different from that in the system memory13. Data in the SD memory card 15 is held in continuous memory areadesignated for each command and has an address designated by thecommand. The data length is variable and is designated by the othercommand.

DMA transfer directly accesses the system memory 13 by the physicaladdress. Accordingly, DMA can be executed by forming a descriptor as atransfer list in the system memory 13.

FIG. 3 shows a descriptor according to this embodiment. This descriptoris formed in the descriptor table 22 of the system memory 13.

The descriptor of this embodiment extends a conventional descriptor andhas a hierarchical structure. When using the descriptor of thisembodiment, data transfer performed between the system memory 13 and SDmemory card 15 by ADMA is completely executable by hardware. Thisobviates the need to interrupt the host CPU 12 during data transfer.Although an error processing request is notified by an interrupt, noproblem arises because the probability of its occurrence is very low.

As shown in FIG. 3, a first descriptor (integrated descriptor) is a setof pointers to a plurality of second descriptors (partial descriptors).

Each second descriptor (partial descriptor) is a pair of a thirddescriptor (SD command descriptor) and a fourth descriptor (systemmemory descriptor).

The contents of the third descriptor are formed by information forissuing an SD command. That is, the contents of the third descriptor areformed by, e.g., a command number, a command mode, an argument, and ablock length and the number of blocks as information necessary for datatransfer. The command mode indicates, e.g., read/write. One SD commandis issued by writing the third descriptor in the SD command generationunit of the register set 33 of the SD host controller 14.

The contents of the fourth descriptor (system memory descriptor) areformed by an address indicating the position of each data in the systemmemory 13, and a length indicating the data length, and indicate a setof a plurality of fragmented data.

Since the third descriptor corresponds to one of read/writ commands, onecontinuous region of the SD memory card can be designated. As shown inFIG. 2, when the memory region is divided into two or more regions, eachof the regions needs the third descriptor. Therefore, the fourthdescriptor corresponding to the third descriptor is programmed to thesame data length as that of each third descriptor.

The first to fourth descriptors each have attribute information Att.Each attribute information Att contains, e.g., information foridentifying the type of descriptor, and an end bit indicating the endposition of the descriptor.

Note that the third descriptor has a format different from that of theother descriptors, so the attribute information Att may be provided inaccordance with at least the first command number. Moreover, theattribute information Att may be provided with each line the same asanother descriptor.

FIG. 4 shows an outline of the arrangement of the ADMA 34. The ADMA 34includes a system address controller 34 a, data buffer 34 b, SD commandcontroller 34 c, and buffer memory 34 d.

The system address controller 34 a manages addresses in the systemmemory 13. More specifically, the system address controller 34 a managesthe load of the first to fourth descriptors stored in the system memory13. That is, the start address of the first descriptor (integrateddescriptor) is set in the system address controller 34 a as initialvalue. Thereby, the system address controller 34 a is able to readinformation of the first descriptor from the memory 13. Since pointersof each of the second descriptors are described in the first descriptor,the system address controller 34 a reads an address of the seconddescriptor designated by each of the pointers and reads the seconddescriptor in accordance with the address. Then, the system addresscontroller 34 a transfers an SD command descriptor as the thirddescriptor forming the second descriptor to the SD command controller 34c. In addition, the system address controller 34 a sequentially loadsthe address and data length of data described in the fourth descriptorforming the second descriptor. In accordance with the loaded address anddata length, the system address controller 34 a reads data from thesystem memory 13 and transfers the data to the data buffer 34 b whenperforming memory write. When performing memory read, the system addresscontroller 13 a transfers data from the data buffer 34 b to the systemmemory 13.

To execute these operations, the system address controller 34 a includesa plurality of registers 34 a_1 to 34 a_4, and a multiplexer (MPX) 34a_5 for selecting output signals from these registers, in order to holdthe start address of the first descriptor (integrated descriptor), thepointer of the second descriptor (partial descriptor), and the addressand data length of data.

The SD command controller 34 c sequentially generates register addressesfor setting values in the SD command generation unit, and sequentiallysets, in the SD command generation unit of the register set 33 of thehost controller 14, register setting information contained in an SDcommand descriptor as the third descriptor. When the setting of theregisters is complete, the SD command generation unit of the registerset 33 issues an SD command.

In memory write, the buffer memory 34 d loads data in the system memory13, which is designated by the system address controller 34 a, andtemporarily holds the supplied data. The data held in the data buffer 34b is transferred to the SD memory card 15 in synchronism with an issuedSD command.

In memory read, the buffer memory 34 d temporarily holds data loadedfrom the SD memory card 15 as a memory device in synchronism with anissued SD command, and transfers the data to a position in the systemmemory 13, which is designated by the system address controller 34 a.

The operation of the ADMA 34 using the extended descriptor in theabove-mentioned configuration will be explained below with reference toFIG. 5.

To perform data transfer between the system memory 13 and SD memory card15, the host driver 21 forms the extended descriptor as shown in FIG. 3in the system memory 13. The host driver 21 sets the start address ofthe first descriptor in register 34 a_1 of the system address controller34 a.

When the host driver 21 activates the ADMA 34 after that, the systemaddress controller 34 a loads a second descriptor pointer (partialdescriptor pointer) described at the head of the first descriptor(integrated descriptor), based on the start address of the firstdescriptor held in register 34 a_1, and holds the second descriptorpointer in register 34 a_2 (ST11).

Then, the system address controller 34 a loads a second descriptor inthe location indicated by the second descriptor pointer (ST12).

The third descriptor (SD command descriptor) described at the head ofthe second descriptor is supplied to the SD command controller 34 c. TheSD command controller 34 c writes data described in the thirddescriptor, in the SD command generation unit forming the register set33 of the SD host controller 14. Consequently, the SD command generationunit issues a command to the SD memory card 15 (ST13).

Subsequently, the system address controller 34 a loads the fourthdescriptor (system memory descriptor). The system address controller 34a holds the address and data length described in the fourth descriptor,in register 34 a_3 (address) and register 34 a_4 (length), respectively.In memory write, the system address controller 34 a reads data from thesystem memory 13 by using the address in register 34 a_3 (address) asthe start address, and transfers the read data to the data buffer 34 b.In memory read, the system address controller 34 a writes data of thedata buffer 34 b in the system memory 13 by using the address inregister 34 a_3 (address) as the start address (ST14).

In memory write, fragmented data supplied from the system memory 13 arecombined into continuous data in the data buffer 34 b. The fourthdescriptor (system memory descriptor) is made up of a plurality of dataeach formed by a pair of the address and data length, and the ADMAperforms data transfer between the system memory and data buffer 34 b byrepeating this.

After that, the ADMA transfers the data held in the data buffer 34 b tothe SD memory card 15 (ST15). The ADMA accesses data in the systemmemory 13 in synchronism with an issued command (read/write command),and data transfer between the memory and card is executed via the databuffer 34 b by synchronizing them. The total data transfer amounts onthe memory device side and system memory side must be set at the samevalue.

When data transfer based on one second descriptor is complete, whetherthe execution of the whole first descriptor is complete is determined(ST16). If the execution of the whole first descriptor is not complete,the control returns to step ST12, the next second descriptor is loadedin accordance with the partial descriptor pointer described in the firstdescriptor, and the above operation is executed (ST16-ST12). Eachdescriptor has the end bit in the above-mentioned attribute informationAtt, and the end position of the descriptor program can be designated bythis end bit.

When the third descriptor is set in the register of the SD hostcontroller 14 in accordance with the next second descriptor, an SDcommand is issued, and data is transferred in accordance with the fourthdescriptor. In memory read, for example, after final data is transferredto the data buffer 34 b, it is also possible to issue the SD command ofthe next transmission during DMA transfer to the system memory byreading the following third descriptor. In this case, the operationspeed can further be increased because the command issuing time ishidden.

On the other hand, if all the contents described in the first descriptorhave been executed, the SD host controller 14 generates an ADMAcompletion interrupt (ST17). This allows the CPU 12 (host driver 21) toknow the normal termination of the ADMA processing. If no error occurs,the host CPU 12 need not participate in transfer from the activation tothe termination of the ADMA, so the host driver does not deteriorate theperformance. In addition, the descriptor formation time has no influenceon the transfer performance because the next descriptor can be preparedduring data transfer.

A file system is instructed by the host driver to update information,when the transmission is completed. Thereby, the data transferred to theSD memory card is decided.

In the above embodiment, the host driver 21 generates the extendeddescriptor in the system memory 13 in order to perform data transferbetween the system memory 13 and SD memory card 15. This extendeddescriptor includes the first descriptor as a set of pointers indicatingthe positions of the second descriptors. When the host driver 21activates the ADMA 34, the ADMA 34 sequentially loads the contents ofthe second descriptors based on the contents of the start address of thefirst descriptor, and executes data transfer between the system memory13 and SD memory card 15 in accordance with the contents of the thirdand fourth descriptors described in the second descriptors. Therefore,the host driver 21 does not participate in data transfer executed by theADMA 34. This enables the ADMA 34 to perform high-speed data transfer.

Also, after being activated, the ADMA 34 generates a command by settingthe third descriptor in the SD command generation unit of the registerset 33, and can execute data transfer between the system memory 13 andSD memory card 15 by using hardware alone. This makes the operationspeed much higher than that when the host driver 21 intervenes in theoperation.

Furthermore, to operate the host driver during data transfer, the hostdriver is normally activated by an interrupt. Accordingly, the datatransfer performance deteriorates if the interrupt response time is notnegligible. However, the method of this embodiment can avoid theperformance deterioration like this.

While certain embodiments have been described, these embodiments havebeen presented by way of example only, and are not intended to limit thescope of the inventions. Indeed, the novel embodiments described hereinmay be embodied in a variety of other forms; furthermore, variousomissions, substitutions and changes in the form of the embodimentsdescribed herein may be made without departing from the spirit of theinventions. The accompanying claims and their equivalents are intendedto cover such forms or modifications as would fall within the scope andspirit of the inventions.

What is claimed is:
 1. A host system comprising: a CPU; a hostcontroller; a system memory configured to be accessed by the CPU and thehost controller, the system memory configured to store data, a firstdescriptor, and a plurality of third and fourth descriptors; and amemory device which is connected to the host controller through aninterface, wherein the host controller includes: a register set which isconfigured to control a command which is issued to the memory device;and a direct memory access (DMA) unit which is configured to load thefirst, third, and fourth descriptors in the system memory, and isconfigured to transfer data between the system memory and the memorydevice according to the first, third, and fourth descriptors, said hostcontroller is configured to load the first descriptor which includes aset of a plurality of pointers indicating the third descriptors, each ofthe third descriptors including information necessary to issue thecommand to the memory device, and information necessary for datatransfer between the host controller and the memory device, each of thethird descriptors is followed by each of the fourth descriptors, andeach of the fourth descriptors including information necessary for datatransfer between the host controller and the system memory, and the hostcontroller is configured (1) to set contents of each of the thirddescriptors to the register set, and issues the command to the memorydevice, (2) to execute the DMA unit to transfer data between the systemmemory and the memory device via the host controller in accordance withcontents of each of the third descriptors and each of the fourthdescriptors, and (3) to repeat (1) and (2) for each third descriptor andfourth descriptor indicated by each pointer in the first descriptor,wherein the host controller is configured to generate an interruptsignal indicating all data transfer described in the first descriptorhas been completed.
 2. The host system according to claim 1, wherein theCPU executes a host driver stored in the system memory, the host drivertransfers the data between the host controller and the memory device,and generates the first, third and fourth descriptors in accordance withposition of data on the system memory and the memory device, the first,third and fourth descriptors generated by the host driver are stored inthe system memory, the host driver designates start of the DMA datatransfer to the host controller, and processes interrupts generated bythe host controller when the DMA data transfer is completed or when adata transfer is stopped by an error.
 3. The host system according toclaim 1, wherein the host controller comprises: a system addresscontroller configured to control an address of the system memorypointing to data and each of the first descriptor, the thirddescriptors, and the fourth descriptors; a command controller configuredto set, to the register set of the host controller, contents of thethird descriptors read from the system memory to issue the command tothe memory device; and a data buffer configured to store data from thesystem memory and read the data stored from the system memory to writethe data to the memory device, or to store data from the memory deviceand read the data stored from the memory device to write the data to thesystem memory.
 4. The host system according to claim 1, wherein each ofthe first descriptor, the third descriptors, and the fourth descriptorshas attribute information containing information for identifying a typeof descriptor, and information indicating size of the respectivedescriptor.
 5. The host system according to claim 1, wherein the thirddescriptors includes information necessary to set a command argument, acommand number, a command operation mode, a block length and the numberof blocks; wherein each of the fourth descriptors includes informationindicating necessary to designate a system memory area; addresses andsizes of a plurality of data arranged in the system memory.
 6. The hostsystem according to claim 1, wherein the data transfer between the hostcontroller and the memory device is started by the command.
 7. The hostsystem according to claim 6, wherein the memory device acquiresinformation necessary for the data transfer between the host controllerand the memory device from the command.